<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
	    Cookie[] cookies = request.getCookies();
		boolean flag = true;
	    if (null != cookies){
	    	//判断cookie不为null之后，判断cookies里面的内容
	    	for(Cookie cookie : cookies){
	    		if("username".equals(cookie.getName())){
	    			if("root".equals(cookie.getValue())){
						continue;
	    			}else{
	    				flag = false;
	    				break;
	    			}
	    		}
	    		if("password".equals(cookie.getName())){
	    			if("19951217".equals(cookie.getValue())){
	    				continue;
	    			}else{
	    				flag = false;
	    				break;
	    			}
	    		}
	    	}
	    	
	    	if(flag){
 	%>
 		<%="Hello　Session" %>
 	<%
	    	}else{
  	%>
  		<jsp:forward page="login.jsp" /> 
  	<% 
	    	}
	    }
	%>
</body>
</html>